﻿using System.Collections.Generic;

namespace PMS.Data.Entities.SystemModules
{
    /// <summary>
    /// Represents a systemmodule-customer role mapping class
    /// </summary>
    public partial class SystemModuleCustomerRoleMapping : BaseEntity
    {
        /// <summary>
        /// Gets or sets the SystemModule identifier
        /// </summary>
        public int SystemModuleId { get; set; }

        /// <summary>
        /// Gets or sets the customer role identifier
        /// </summary>
        public int CustomerRoleId { get; set; }

        /// <summary>
        /// Gets or sets the permission of SystemModule which the customer whether can Access for Viewing
        /// </summary>
        public bool ViewPermission { get; set; }

        /// <summary>
        /// Gets or sets the permission of SystemModuleButtons assigned to SystemModule
        /// which the customer whether can operation
        /// SystemModuleButtonIds separated by comma such like "1,3,6,7...."
        /// </summary>
        public string AuthorizedButtonIds { get; set; }

        public IList<int> AuthorizedButtons 
        {
            get => ConvertFromString(AuthorizedButtonIds);
            set => AuthorizedButtonIds = ConvertFromArray(value);
        }
    }

}
